package com.zy.chat.controller;


import com.zy.chat.service.IFollowService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.http.HttpStatus;
import org.springframework.http.ResponseEntity;
import org.springframework.web.bind.annotation.*;

@RestController
@RequestMapping("/follow")
public class FollowController {


    @Autowired
    private IFollowService followService;
    @GetMapping("/{id}/{isFollow}")
    public ResponseEntity<Boolean> follow(@PathVariable("id") String followUser, @PathVariable("isFollow")Boolean isFollow){
        return new ResponseEntity<Boolean>(followService.follow(followUser,isFollow), HttpStatus.OK) ;
    }

    @GetMapping("/or/not/{followUser}")
    public ResponseEntity<Boolean>  isfollow(@PathVariable("followUser")String followUser){
        return new ResponseEntity<Boolean>( followService.isFollow(followUser),HttpStatus.OK);
    }
}
